package demo;

import java.util.BitSet;

import manipulator.BitSequenceV2;

public class Demo {
	public static void main(String[] args) {
		int size = 1000;
		BitSequenceV2 bzs = new BitSequenceV2(size);
		
		for (int i = 0; i < 32; i++)
			bzs.stuff(0x18801148, i+1); // 0b0001 1000 1000 0000 0001 0001 0100 1000
		
		BitSet bits = bzs.getBitSet();
		int p = 1;
		int k = 1;
		for (int i = 0; i < size; i++, k++) {
			System.out.print(bits.get(i)?'1':'0');
			
			if (k == p) {
				System.out.println(" (" + p + ") ");
				p++;
				k = 0;
			}
		}
		
		System.out.println();
		
		byte[] b = bzs.makeByte();
		for (int i = 0; i < b.length; i++) {
			if (i % 8 == 0) System.out.println();
			System.out.printf("%3x", b[i]);
		}
	}
}
